home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Scripts / Menu Events 1.2 / Menu Events Help / Menu Events Help.rsrc / STR#_1026.txt < prev    next >
Encoding:
Text File  |  1994-10-17  |  4.8 KB  |  219 lines

  1. 
  2.  
  3. 
  4.  
  5. x
  6.  
  7. x
  8.  
  9. √•What Does Menu Events Do?
  10.  
  11. 
  12.  
  13. 
  14.  
  15. Menu Events is a system extension.  Once you have placed it in your
  16.  
  17. Extensions folder and restarted your Macintosh, it adds a small suite of
  18.  
  19. Apple events (‚ÄúMenu events‚Äù) to the set supported by every
  20.  
  21. high-level-event-aware application.  Also, if the Caps Lock key is down,
  22.  
  23. it alters menu selection logic so that every selection causes the
  24.  
  25. application to send itself a Menu event.  This behavior enables script
  26.  
  27. recording of menu actions.
  28.  
  29. 
  30.  
  31. 
  32.  
  33. Many people are justly wary of control panels and system extensions,
  34.  
  35. because of the conflicts they often cause with System software and with
  36.  
  37. each other.  These conflicts usually result from competitive trap patching.
  38.  
  39. 
  40.  
  41. Menu Events installs a GetNextEvent filter and patches the MenuSelect
  42.  
  43. trap at system startup to enable the self-sending behavior, and installs an
  44.  
  45. Apple event handler in the system dispatch table.  The Apple event handler
  46.  
  47. cannot conflict with any other, because it is bound specifically to the
  48.  
  49. Menu event class.  Menu Events does patch some traps ‚Äúon the fly‚Äù to
  50.  
  51. simulate menu selection, but the patches remove themselves immediately.
  52.  
  53. 
  54.  
  55. There are three events defined in the suite, and they work as follows.
  56.  
  57. See the section entitled ‚ÄúMenu Events Suite‚Äù for more information on the
  58.  
  59. Menu Events suite.
  60.  
  61. 
  62.  
  63. 
  64.  
  65. 
  66.  
  67. xQuery Menu List Event
  68.  
  69. 
  70.  
  71. This event, with no parameters, queries the menu list of the target
  72.  
  73. application.  If the application is high-level-event-aware, not
  74.  
  75. background-only, and has a menu bar, it will return a list of records, each
  76.  
  77. containing a menu ID (integer), a title (string), an enable/disable
  78.  
  79. (Boolean), and a menu definition procedure resource ID (integer)
  80.  
  81. parameter.  If you do not know the IDs of the target application‚Äôs menus,
  82.  
  83. this is one way to find out.  (Another way is to press the Caps Lock key
  84.  
  85. and record menu actions using a script editor; yet another is to use the
  86.  
  87. Menu Grabber application, also part of AWOL Utilities.)  Be aware that
  88.  
  89. menu IDs do not have to agree with 'MENU' resource IDs, though they
  90.  
  91. often do.
  92.  
  93. 
  94.  
  95. See the section entitled ‚ÄúSuggestions for Use‚Äù for more information on
  96.  
  97. Menu Grabber.
  98.  
  99. 
  100.  
  101. System menus (Keyboard, Help, Application), hierarchical menus, and
  102.  
  103. pop-up menus do not appear in this list, but the Apple menu does.
  104.  
  105. 
  106.  
  107. NOTE:  The standard menu definition procedure ('MDEF') resource ID is 0.
  108.  
  109. A value of -1 indicates that the menu definition procedure is not a
  110.  
  111. resource.  Non-standard menu definition procedures may have abnormal
  112.  
  113. ways of counting, disabling, and displaying menu items, so be careful with
  114.  
  115. them.
  116.  
  117. 
  118.  
  119. 
  120.  
  121. 
  122.  
  123. xQuery Menu Event
  124.  
  125. 
  126.  
  127. This event, given a menu ID (integer) parameter, queries the items of a
  128.  
  129. certain target application menu.  If the application has a menu with that
  130.  
  131. ID, be it a regular, system, hierarchical, or pop-up menu, it will return a
  132.  
  133. list of records, each containing a menu item ID (integer), an item title
  134.  
  135. (string), an enable/disable (Boolean), a mark character (integer), an icon
  136.  
  137. ID (integer), a style value (integer), and a Command character (integer)
  138.  
  139. parameter.  The items are numbered starting from 1 at the top end of the
  140.  
  141. menu.  Separators appear as disabled items with an item title of ‚Äú-‚Äù.
  142.  
  143. 
  144.  
  145. 
  146.  
  147. This event does work for menus which use a non-standard menu definition
  148.  
  149. procedure ('MDEF'), but the results may or may not reflect what you see
  150.  
  151. when you pull down the menu, depending on how the procedure was
  152.  
  153. programmed.
  154.  
  155. 
  156.  
  157. 
  158.  
  159. 
  160.  
  161. xSelect Menu Item Event
  162.  
  163. 
  164.  
  165. This event, given a menu ID (integer) and a menu item ID (integer)
  166.  
  167. parameter, asks the application to act as though the user pulled down that
  168.  
  169. menu and selected that item.  This does not work for the Keyboard and
  170.  
  171. Application menus, which are not under the control of the application, nor
  172.  
  173. for the upper (System-defined) part of the Help menu, but it works for
  174.  
  175. any regular, application-defined, enabled menu item.
  176.  
  177. 
  178.  
  179. 
  180.  
  181. You may optionally include Boolean parameters to indicate which modifier
  182.  
  183. keys (Shift, Control, Option, Command) are pressed at the time of the
  184.  
  185. simulated menu item selection, in case this makes a difference in the
  186.  
  187. effect of the selection.
  188.  
  189. 
  190.  
  191. This event does work for menus which use a non-standard menu definition
  192.  
  193. procedure ('MDEF'), but the results may or may not reflect what happens
  194.  
  195. when you select from the menu, depending on how the procedure was
  196.  
  197. programmed.
  198.  
  199. 
  200.  
  201. This event brings the target application to the front before forcing the
  202.  
  203. menu selection upon it.  If the sender was on the same machine, and was
  204.  
  205. previously in front, it returns to the front after the menu action is
  206.  
  207. complete.
  208.  
  209. See the section entitled ‚ÄúHow Does Menu Events Work?‚Äù for more
  210.  
  211. information about the method by which Menu Events activates the target
  212.  
  213. application.
  214.  
  215. 
  216.  
  217. 
  218.  
  219.